package com.zdy.demo;

/**
 * Created by 逸足天涯
 * on 3/8/2020.
 */
//实现同步下载图片
public class TestThread2_3 implements Runnable{
    private String url;
    private String name;

    public TestThread2_3(String url,String name){
        this.url = url;
        this.name = name;
    }
    @Override
    public void run() {
        WebDownLoader webDownLoader = new WebDownLoader();
        webDownLoader.downLoader(url,name);
        System.out.println("下载了文件名为：" + name);

    }

    public static void main(String[] args) {
        TestThread2 t1 = new TestThread2("https://www.baidu.com/img/dong3_ce6e6a5ce66ab92f491f627981a2f77c.gif","图片1");
        TestThread2 t2 = new TestThread2("http://img95.699pic.com/photo/50155/6342.jpg_wh860.jpg!/both/590x400","图片2");
        TestThread2 t3 = new TestThread2("https://imgconvert.csdnimg.cn/aHR0cHM6Ly9tbWJpei5xcGljLmNuL21tYml6X3BuZy96eG9MYWVDSTI4U2dSNUVZTTBlY0UyT1VCdkZBZHo0TUhubFBEaGxjcmJNMnlueG0wWUpqNFBDTGxQS0FuUW1UeHpYTDVqVHlnYnRoM0lQOGVZRjVhZy82NDA?x-oss-process=image/format,png","图片3");
       new Thread(t1).start();
       new Thread(t2).start();
       new Thread(t3).start();

    }
}


